<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/public/header.jsp"%>
<%
	String is_closed = request.getParameter("is_closed") == null ? "0" : request.getParameter("is_closed");
    String gd_id = request.getParameter("gd_id") == null ? "" : request.getParameter("gd_id");
    String gd_content_id = request.getParameter("gd_content_id") == null ? "" : request.getParameter("gd_content_id");
    String dept_id = request.getParameter("dept_id") == null ? "" : request.getParameter("dept_id");
    String dept_name = request.getParameter("dept_name") == null ? "" : request.getParameter("dept_name");
    String gd_code = request.getParameter("gd_code") == null ? "" : request.getParameter("gd_code");
    String gd_name = request.getParameter("gd_name") == null ? "" : request.getParameter("gd_name");
    String customer_id = request.getParameter("customer_id") == null ? "" : request.getParameter("customer_id");
    String customer = request.getParameter("customer") == null ? "" : request.getParameter("customer");
%>
<html>
	<head>
		<title>工单材料</title>
	</head>
	<script type="text/javascript">
	$(function(){
		var arr=new Array("甲供材","乙供材");
		var arrUrl=new Array(
						 "customerMaterial.jsp?gd_id=<%=gd_id%>&gd_content_id=<%=gd_content_id%>&dept_id=<%=dept_id%>&dept_name=<%=dept_name%>&gd_code=<%=gd_code%>&gd_name=<%=gd_name%>&customer_id=<%=customer_id%>&customer=<%=customer%>",
						 "purchaseTab.jsp?type=1&gd_id=<%=gd_id%>&gd_content_id=<%=gd_content_id%>&dept_id=<%=dept_id%>&dept_name=<%=dept_name%>&gd_code=<%=gd_code%>&gd_name=<%=gd_name%>"
	                     );
		
		for(var i=0;i<arr.length;i++){
			if($("#tt").tabs('exists',arr[i])){
				$("#tt").tabs('select',arr[i]);
			}else{
				$('#tt').tabs('add',{  
   				title:arr[i],
   				closable:false,
   				content:'<iframe frameborder="0" src="" style="width:100%;height:99%;" scrolling="auto"></iframe>'
				});  
			}
		}
		
		 $('#tt').tabs({  
				onSelect:function(title,index){
			 	var tab = $(this).tabs('getTab',title);
			 	for(var i=0;i<arr.length;i++){
			 		if(index == i){
			 			tab.find('iframe').attr('src',arrUrl[index]);
			 		}
			 	}
	   		}
		});  
	});
	</script>
	<body>
		<div class="easyui-layout" data-options="fit:true">
		 <div region="center" >
			<div id="tt" class="easyui-tabs"  data-options="fit:true">  
		 	</div>
   		</div>  
	</body>
</html>
